if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
    find_package(OpenSSL QUIET)

    link_directories(${PROJECT_SOURCE_DIR}/lib)
    message(STATUS "Current source directory: ${PROJECT_SOURCE_DIR}")
    set(WROKFLOW workflow OpenSSL::SSL OpenSSL::Crypto)
endif()

set(workflow_FOUND FALSE)
if (EXISTS "${PROJECT_SOURCE_DIR}/lib/libworkflow.a")
    set(workflow_FOUND TRUE)
endif()

if(OpenSSL_FOUND AND workflow_FOUND)
    build_all_target(${WROKFLOW})
else()
    get_filename_component(CURRENT_DIR_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
    message(STATUS "workflow not found! Skipping ${CURRENT_DIR_NAME}")
endif()
